<?php

/**
 * Hoa Framework
 *
 *
 * @license
 *
 * GNU General Public License
 *
 * This file is part of HOA Open Accessibility.
 * Copyright (c) 2007, 2008 Ivan ENDERLIN. All rights reserved.
 *
 * HOA Open Accessibility is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * HOA Open Accessibility is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with HOA Open Accessibility; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 *
 * @category    Framework
 * @package     Hoa_VideoPlayer
 * @subpackage  Hoa_VideoPlayer_Parser_Abstract
 *
 */

/**
 * Hoa_Framework
 */
require_once 'Framework.php';

/**
 * Hoa_VideoPlayer_Exception
 */
import('VideoPlayer.Exception');

/**
 * Class VideoPlayer Parser Abstract
 *
 * @author      Grégory DARCHE <gregory.darche@netiva.fr>
 * @copyright   Copyright (c) 2009 Grégory DARCHE.
 * @license     http://gnu.org/licenses/gpl.txt GNU GPL
 * @since       PHP 5
 * @version     0.1
 * @package     Hoa_VideoPlayer
 * @subpackage  Hoa_VideoPlayer_Server_Abstract
 */

abstract class Hoa_VideoPlayer_Parser_Abstract {

    /**
     * Url de la vidéo
     *
     * @var   string
     */ 
    public $url = null;

    /**
     * Id de la vidéo
     *
     * @var   string
     */ 
    public $id = null;

    /**
     * __tostring
     * Retourne l'id de la vidéo
     * 
     * @return   Id vidéo
     */
    abstract public function parser();

    /**
     * __construct
     * Constructeur 
     * 
     * @param   $url    Url a parser
     */
    public function __construct ( $url=null ) {

        if (is_null($url) OR !is_string($url))
            throw new Hoa_VideoPlayer_Exception('Url could be a string.', 1);

        $this->url = $url;
        
        $this->parser();
    }

    /**
     * __tostring
     * Affichage
     * 
     * @return   Id vidéo
     */
    public function __tostring ( ) {

        return $this->id;;  
    }

    /**
     * getParser
     * Retourne le nom du parser
     * 
     * @return   nom du player
     */
    public function getParser ( ) {

        return $this->parser;
    }

}
